<template>
<div class="ca-box ca-p-15">
    <el-tabs @tab-click="handleClick" :value="tabIndex" v-if="$route.name.includes('pre-investment-funds')">
        <el-tab-pane :label="tabArr[0]" :disabled="!isAuthTabPre" >
            <div v-if="activeIndex == 0">
                <csFundInfo></csFundInfo>
                <csManagementAgency></csManagementAgency>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[1]" :disabled="!isAuthTabPre">
            <div v-if="activeIndex == 1">
                <csManagementTeam></csManagementTeam>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[2]" :disabled="!isAuthTabPre">
            <div v-if="activeIndex == 2">
                <csManagementOperation></csManagementOperation>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[3]" :disabled="!isAuthTabPre">
            <div v-if="activeIndex == 3">
                <csProjectReserve></csProjectReserve>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[4]" :disabled="!isAuthTabPre">
            <div v-if="activeIndex == 4">
                <csInvestmentCase></csInvestmentCase>
            </div>
        </el-tab-pane>
    </el-tabs>
    <el-tabs @tab-click="handleClick" :value="tabIndex" v-else>
        <el-tab-pane :label="tabArr[0]" :disabled="!isAuthTab" >
            <div v-if="activeIndex == 0">
                <csFundInfo></csFundInfo>
                <csManagementAgency></csManagementAgency>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[1]" :disabled="!isAuthTab">
            <div v-if="activeIndex == 1">
                <csManagementTeam></csManagementTeam>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[2]" :disabled="!isAuthTab">
            <div v-if="activeIndex == 2">
                <csManagementOperation></csManagementOperation>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[3]" :disabled="!isAuthTab">
            <div v-if="activeIndex == 3">
                <csProjectReserve></csProjectReserve>
            </div>
        </el-tab-pane>
        <el-tab-pane :label="tabArr[4]" :disabled="!isAuthTab">
            <div v-if="activeIndex == 4">
                <csInvestmentCase></csInvestmentCase>
            </div>
        </el-tab-pane>
    </el-tabs>
</div>
</template>
<script type="text/ecmascript-6">
    import { isNoAuth } from '__service/utils';
    export default {
        data() {
            return {
                tabIndex: 0,
                tabArr: ['管理机构', '管理团队', '管理和运行', '项目储备', '投资案例'],
                isAuthTab: isNoAuth('基金储备库-基金详情-查看'),
                isAuthTabPre: isNoAuth('拟投资基金-基金详情-查看'),
                // id: this.$route.params.itemId,
                // showBetting: true,
                // preId: '',
                // dotStateList: [false, false, false, false, false, false, false], // 小红点状态
                // // 当前选中的tab
                activeIndex: 0,
                // tabIndex: this.$route.params.tabIndex.toString(),
            }
        },
        watch: {
        },
        props: {},
        mounted() {
        },
        methods: {
            // 切换tab
            handleClick(val) {
                this.activeIndex = val.index;
            }
        },
        beforeDestroy() {
        },
        components: {
            csFundInfo: require('./fund-info/index'), //基金详情
            csManagementAgency: require('./management-agency/index'), //管理机构信息
            csManagementTeam: require('./management-team/index'), //管理团队
            csManagementOperation: require('./management-operation/index'), //管理和运行
            csProjectReserve: require('./project-reserve/index'), //项目储备
            csInvestmentCase: require('./investment-case/index'), //投资案例
        },
    }
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>